package com.usian.service.impl;

import com.usian.mapper.UserMapper;
import com.usian.pojo.User;
import com.usian.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    private final static Logger logger = LoggerFactory.getLogger(UserServiceImpl.class);

    @Autowired
    private UserMapper userMapper;

    @Override
    public void insertUser(User user) {

        logger.debug("===============用户保存service");
        userMapper.insertUser(user);
    }

    @Override
    public List<User> findAll(Integer userId) {
        return userMapper.findAll(userId);
    }

    @Override
    public List<User> findList() {
        return userMapper.findList();
    }

    @Override
    public User findById(Integer id) {
        return userMapper.selectById(id);
    }

    @Override
    public void updateUser(User user) {
        userMapper.updateById(user);
    }

    @Override
    public void deleteById(Integer id) {
        userMapper.deleteById(id);
    }

    @Override
    public void testCorn() {

        logger.info("service  add   user 。。。。。。。。。。。。");
    }
}
